﻿@{
    ViewBag.Title = "加工计划";
    Layout = "~/Views/Shared/_LayoutList.cshtml";
}
@(  
 Html.DWZGridFor<MaterialProcessPlan>()
     .ID("grdList")
    .Title("加工计划列表")
    .Action(@Url.Action("List"))
    .Columns(col =>
    {
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.Date).Width(70).DateFormat("yyyy-MM-dd");
        col.Bind(e => e.Code).Width(60).AsQuery();
        col.Bind(e => e.Name).Width(100).AsQuery().Align(FlexiGridAlign.Left);
        col.Bind(e => e.Category).EnumKey("MaterialCategory").Width(60);
        col.Bind(e => e.TotalWeight).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.PurchaseWeight).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.ActualSorage).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.SafeStorage).Width(50).Align(FlexiGridAlign.Right);
    })
        .Buttons(btn =>
        {
            btn.Bind("Add", "生成加工单", FlexiGridButtonType.Add).OnPress("CrateMPurchase");
        })
)
<script type="text/javascript">
    function CrateMPurchase() {
        OpenModelWindow('@Url.Action("PlanList", "MaterialProcessPlan")', { width: 610, height: 450, caption: "生成加工单", onclose: refreshGrid });
    }

</script>
